// with polyfills
import 'core-js/stable'
import 'regenerator-runtime/runtime'

import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store/'
// import i18n from './locales'
import i18n from './locales/index'
Vue.use(i18n)

import echarts from 'echarts';

import ProLayout, { PageHeaderWrapper } from '@ant-design-vue/pro-layout'
import themePluginConfig from '../config/themePluginConfig'
import Directives from './directives';
Vue.use(Directives);
// mock
// WARNING: `mockjs` NOT SUPPORT `IE` PLEASE DO NOT USE IN `production` ENV.
// import './mock' 
import bootstrap from './core/bootstrap'
import './core/lazy_use' // use lazy load components
import './permission' // permission control
import './utils/filter' // global filter
import './assets/style/global.less' // global style
import 'windi.css'
import tools from './utils/tool.js'
import './assets/style/font.less' // 加载企业字体

Vue.use(tools)

// 屏蔽错误信息
// Vue.config.errorHandler = () => null;
// 屏蔽警告信息
// Vue.config.warnHandler = () => null;

Vue.config.productionTip = false
// 禁止右键
// document.oncontextmenu = new Function("event.returnValue=false");
Vue.prototype.$echarts = echarts
// use pro-layout components
Vue.component('pro-layout', ProLayout)
Vue.component('page-container', PageHeaderWrapper)
Vue.component('page-header-wrapper', PageHeaderWrapper)

window.umi_plugin_ant_themeVar = themePluginConfig.theme
// const i18n = new VueI18n({
//   locale: 'zh-CN', // 设置语言环境，默认中文
//   messages: {
//     'zh-CN': require('./locales/lang/zh-CN'),
//     'zh-EN': require('./locales/lang/zh-EN')
//   }
// })
new Vue({
  router,
  store,
  i18n,
  // init localstorage, vuex, Logo message
  created: bootstrap,
  render: h => h(App),
  beforeCreate(){
    Vue.prototype.$bus = this // 安装全局事件总线
  },
}).$mount('#app')
